<template>
  <div class="app-container">
    <div style="width: 100%; height: 35px;">
      <span style="font-size: 18px;">科研项目名称：{{ checkedProject.name }}</span>
      <el-button type="warning" size="small" link style="float: right; margin-left: 10px;"  @click="reback()">返 回</el-button>
    </div>
    <el-card shadow="never" class="mainCard" v-loading="loading">
      <el-tabs v-model="activeName" @tab-click="handleTabsClick">
        <el-tab-pane label="科研样本" name="sample">
          <template>
            <el-button type="success" @click="openDialog()"><i class="el-icon-circle-plus"></i> 新增</el-button>
            <el-button type="warning" link @click="openUploadSampleDialog()"><i class="el-icon-edit"></i> 导入样本</el-button>
            <el-button type="warning" link @click="openUploadUpdateSampleDialog()"><i class="el-icon-edit"></i> 更新样本</el-button>
            <!-- <el-button
                type="warning"
                link
                @click="openUploadSampleDialog()"
              ><i class="el-icon-edit"></i> 导入样本</el-button> -->
            <el-button type="warning" @click="openSearchDialog()"><i class="el-icon-mouse"></i> 高级查询</el-button>
            <el-button
              type="danger"
              :disabled="ids.length === 0"
              @click="handleDelete()"
              ><i class="el-icon-delete"></i> 删除</el-button>
              <el-button type="success" @click="setListValid(true)"><i class="el-icon-lock"></i> 全部有效</el-button>
              <el-button type="success" @click="setListValid(false)"><i class="el-icon-unlock"></i> 全部无效</el-button>
              <el-button type="success" @click="checkFastq()"><i class="el-icon-finished"></i> 检测FastQ文件</el-button>
          </template>
          <div style="height: 280px;">
            <div id="group" style="width: 700px; height: 280px; float: left;"></div>
            <!-- <div id="strategy" style="width: 400px; height: 300px; float: left;"></div>
            <div id="layout" style="width: 400px; height: 300px; float: left;"></div> -->
            <div id="isValid" style="width: 400px; height: 280px; float: left;"></div>
            <div id="isExist" style="width: 400px; height: 280px; float: left;"></div>
          </div>
          
          <p>{{ url }}</p>
          <el-table
            v-loading="loading"
            :data="sampleDataList"
            highlight-current-row
            border
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column type="expand">
              <template slot-scope="props">
                <el-form label-position="left" inline class="demo-table-expand">
                  <el-form-item label="Fastq1">
                    <span>{{ props.row.fastq1 }}</span>
                  </el-form-item>
                  <el-form-item label="Fastq2">
                    <span>{{ props.row.fastq2 }}</span>
                  </el-form-item>
                </el-form>
              </template>
            </el-table-column>
            <el-table-column label="序号" width="55" prop="dataIndex"/>
            <el-table-column label="样本名称" prop="name"/>
            <el-table-column label="样本分组" prop="group"/>
            <el-table-column label="物种" prop="speciesText"/>
            <el-table-column label="实验策略" prop="strategy"/>
            <el-table-column label="测序方式" prop="layoutText"/>
            <el-table-column label="是否有效" prop="isValidText"/>
            <el-table-column label="是否存在" prop="isExistText"/>
            <el-table-column fixed="right" label="操作"  min-width="420" width="420">
              <template #default="scope">
                <el-button type="warning" size="small" link @click="openDialog(scope.row)"><i class="el-icon-edit"></i> 编辑</el-button>
                <el-button type="warning" size="small" link @click="openVaild(scope.row)"><i class="el-icon-edit"></i> 设置有效</el-button>
                <el-button type="primary" size="small" link @click="sendKafka(scope.row)"><i class="el-icon-s-promotion"></i> 发送至Kafka</el-button>
                <el-button type="danger" size="small" link @click="handleDelete(scope.row)"><i class="el-icon-delete"></i> 删除</el-button>
              </template>
            </el-table-column>
          </el-table>

          <div class="block">
            <el-pagination
              @size-change="sampleHandleSizeChange"
              @current-change="sampleHandleCurrentChange"
              :current-page="sampleQueryParams.pageNum"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="10"
              layout="total, sizes, prev, pager, next, jumper"
              :total="sampleTotal">
            </el-pagination>
          </div>
        </el-tab-pane>
        <el-tab-pane label="应用任务" name="task">
          <el-table
            v-loading="loading"
            :data="taskList"
            highlight-current-row
            border
            @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="序号" width="55" prop="dataIndex"/>
            <el-table-column label="运行参数" prop="runArgsContent"/>
            <el-table-column label="所属应用" prop="applicationName"/>
            <el-table-column label="创建时间" prop="createTimeText"/>
            <el-table-column label="更新时间" prop="updateTimeText"/>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="工作空间" name="workspace">

        </el-tab-pane>
      </el-tabs>
    </el-card>

    <el-dialog :visible.sync="validVisible" title="设置是否有效" width="300px" :before-close="clsoeVaild">
      <el-radio v-model="validVal" label="true">有效</el-radio>
      <el-radio v-model="validVal" label="false">无效</el-radio>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="saveValid">保 存</el-button>
        </div>
      </template>
    </el-dialog>

    <el-dialog
      :visible.sync="dialog.visible"
      :title="dialog.title"
      width="900px"
      :before-close="closeDialog"
    >
      <el-form
        ref="seqSampleFormRef"
        :model="formData"
        :rules="seqSampleRules"
        label-width="150px"
      >
        <el-form-item label="样本名称" prop="name">
          <el-input v-model="formData.name" placeholder="请输入样本名称" />
        </el-form-item>
        <el-form-item label="样本分组" prop="group">
          <el-input v-model="formData.group" placeholder="请输入样本分组" />
        </el-form-item>
        <el-form-item label="物种" prop="species">
          <el-select v-model="formData.species" placeholder="请选择物种">
            <el-option label="人类" value="human"></el-option>
            <el-option label="大鼠" value="mouse"></el-option>
            <el-option label="小鼠" value="rat"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="实验策略" prop="strategy">
          <el-select v-model="formData.strategy" placeholder="请选择实验策略">
            <el-option label="Amplicon" value="Amplicon"></el-option>
            <el-option label="Metagenomics" value="Metagenomics"></el-option>
            <el-option label="WES" value="WES"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="测序方式" prop="layout">
          <el-select v-model="formData.layout" placeholder="请选择测序方式">
            <el-option label="单端测序" value="SINGLE"></el-option>
            <el-option label="双端测序" value="PAIRED"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="fastq1" prop="fastq1">
          <el-input v-model="formData.fastq1" placeholder="请输入fastq1" />
        </el-form-item>
        <el-form-item label="fastq2" prop="fastq2" v-show="formData.layout == 'PAIRED'">
          <el-input v-model="formData.fastq2" placeholder="请输入fastq2" />
        </el-form-item>
      </el-form>

      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="addOrUpdate">确 定</el-button>
          <el-button @click="closeDialog">取 消</el-button>
        </div>
      </template>
    </el-dialog>

    <el-dialog
      :visible.sync="searchDialog"
      title="高级查询"
      width="500px"
      :before-close="closeSearchDialog"
    >
      <el-form
        ref="searchFormRef"
        :model="formData"
        label-width="0px"
      >
      <el-form-item v-for="(item, index) in searchFormData" :key="index" label-width="0">
          <el-col :span="7">
            <el-select v-model="searchFormData[index].name">
              <el-option v-for="field in fieldList" :key="field.value" :label="field.label" :value="field.value"></el-option>
            </el-select>
          </el-col>
          <el-col :span="1">&nbsp;</el-col>
          <el-col :span="4">
            <el-select v-model="searchFormData[index].searchType">
              <el-option v-for="cont in contList" :key="cont.value" :label="cont.label" :value="cont.value"></el-option>
            </el-select>
          </el-col>
          <el-col :span="1">&nbsp;</el-col>
          <el-col :span="7">
            <el-select v-model="searchFormData[index].searchVal" v-if="searchFormData[index].name === 'strategy'">
              <el-option label="Amplicon" value="Amplicon"></el-option>
              <el-option label="Metagenomics" value="Metagenomics"></el-option>
              <el-option label="WES" value="WES"></el-option>
            </el-select>
            <el-select v-model="searchFormData[index].searchVal" v-else-if="searchFormData[index].name === 'layout'">
              <el-option label="单端测序" value="SINGLE"></el-option>
              <el-option label="双端测序" value="PAIRED"></el-option>
            </el-select>
            <el-input v-model="searchFormData[index].searchVal" placeholder="请输入查询内容" v-else></el-input>
          </el-col>
          <el-col class="line" :span="4"><i class="el-icon-remove-outline" style="font-size: 22px; cursor: pointer; margin-left: 5px;" @click="delSearchFormData(index)"></i></el-col>
        </el-form-item>
        
      </el-form>
      <div style="margin-top: 10px;">
        <i class="el-icon-circle-plus-outline" style="font-size: 22px; cursor: pointer;" @click="addSearchFormData"></i>
        
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="search">查 询</el-button>
          <el-button @click="closeSearchDialog">取 消</el-button>
        </div>
      </template>
    </el-dialog>

    <el-dialog
      :visible.sync="uploadSampleDialog.visible"
      :title="uploadSampleDialog.title"
      width="800px"
      :before-close="closeUploadSampleDialog">
      <el-form
        ref="uploadSampleFormRef"
        :model="uploadSampleForm"
        :rules="rules"
        label-width="130px">
        <el-form-item label="FastQ 文件基路径" prop="fastqBasePath">
          <el-input v-model="uploadSampleForm.fastqBasePath"  placeholder="请输入FastQ 文件基路径" />
        </el-form-item>
        <el-form-item label="物种" prop="species">
          <el-select v-model="uploadSampleForm.species" placeholder="请选择物种">
            <el-option label="人类" value="human"></el-option>
            <el-option label="大鼠" value="mouse"></el-option>
            <el-option label="小鼠" value="rat"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="实验策略" prop="strategy">
          <el-select v-model="uploadSampleForm.strategy" placeholder="请选择实验策略">
            <el-option label="Amplicon" value="Amplicon"></el-option>
            <el-option label="Metagenomics" value="Metagenomics"></el-option>
            <el-option label="WES" value="WES"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="测序方式" prop="layout">
          <el-select v-model="uploadSampleForm.layout" placeholder="请选择测序方式">
            <el-option label="单端测序" value="SINGLE"></el-option>
            <el-option label="双端测序" value="PAIRED"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="文件内容" prop="content">
          <el-input v-model="uploadSampleForm.content" type="textarea" :autosize="{ minRows: 10, maxRows: 50}" placeholder="请输入文件内容" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="uploadSample">导入样本</el-button>
          <el-button @click="closeUploadSampleDialog">取 消</el-button>
        </div>
      </template>
    </el-dialog>

    <el-dialog
      :visible.sync="uploadUpdateSampleDialog.visible"
      :title="uploadUpdateSampleDialog.title"
      width="800px"
      :before-close="closeUploadUpdateSampleDialog">
      <el-form
        ref="uploadUpdateSampleFormRef"
        :model="uploadUpdateSampleForm"
        :rules="rules"
        label-width="130px">
        <el-form-item label="文件内容" prop="content">
          <el-input v-model="uploadUpdateSampleForm.content" type="textarea" :autosize="{ minRows: 10, maxRows: 50}" placeholder="请输入文件内容" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="uploadUpdateSample">更新样本</el-button>
          <el-button @click="closeUploadUpdateSampleDialog">取 消</el-button>
        </div>
      </template>
    </el-dialog>

  </div>
</template>

<script>

import seqProjectApi from '@/api/sequence/project'
import dfTaskApi from '@/api/analysis/task'
import seqSampleApi from '@/api/sequence/seqSample'
import { formatDate } from '@/utils/formatTime'
export default {
	name: 'projectDetailIndex',
  props: {
		checkedProject: {
			type: Object,
			default: {},
		},
	},
	data() {
		return {
      loading: false,
      dialog: {},
      projectList: [],
      formData: {},
      ids: [],
      rules: {},
      seqSampleRules: {
        name: [{ required: true, message: '请输入样本名称', trigger: 'blur' }],
        group: [{ required: true, message: '请输入样本分组', trigger: 'blur' }],
        species: [{ required: true, message: '请选择物种', trigger: 'change' }],
        strategy: [{ required: true, message: '请选择实验策略', trigger: 'change' }],
        layout: [{ required: true, message: '请选择测序方式', trigger: 'change' }],
      },

      searchFormData: {},
      activeName: 'sample',
      sampleDataList: [],
      taskList: [],
      sampleQueryParams: {
        pageNum: 0,
        pageSize: 10,
        criteriaVos: [{
          name: 'sampleType',
          searchType: 'EQUAL',
          searchVal: 'SCIENTIFIC_RESEARCH'
        }],
      },
      sampleTotal: 0,

      searchFormData: [],
      searchDialog: false,
      fieldList: [{label: '样本名称', value: 'name'}, {label: '测序方式', value: 'layout'}, {label: 'fastq1', value: 'fastq1'}, {label: 'fastq2', value: 'fastq2'}
        , {label: '实验策略', value: 'strategy'}, {label: 'group', value: 'group'}],
      contList: [{label: 'LIKE', value: 'LIKE'}, {label: '等于', value: 'EQUAL'}, {label: '大于', value: 'GT'}, {label: '大于等于', value: 'GTE'}
        , {label: '小于', value: 'LT'}, {label: '小于等于', value: 'LTE'}],

      validVisible: false,
      validVal: '',
      checkedSampleId: '',

      uploadSampleDialog: {},
      uploadSampleForm: {},
      url: '',

      speciesMap: {
        human: '人类',
        hat: '小鼠',
        mouse: '大鼠',
      },

      uploadUpdateSampleDialog: {},
      uploadUpdateSampleForm: {},
		};
	},
  mounted() {
    if (process.env.NODE_ENV === 'production') {
      this.url = process.env.VUE_APP_BASE_API + '/seq-sample-data/list/' + this.checkedProject.id + '?valid=false'
    } else {
      this.url = process.env.VUE_APP_BASE_API + '/api/seq-sample-data/list/' + this.checkedProject.id + '?valid=false'
    }
  },
  methods: {
    uploadUpdateSample () {
      this.uploadUpdateSampleForm.projectId = this.checkedProject.id;
      seqSampleApi.uploadUpdateContent(this.uploadUpdateSampleForm).then(res => {
        if (res.data.length != 0) {
          let names = [];
          res.data.forEach(v => {
            names.push(v.name)
          })
          this.$message.error('样本【'+ names.join(',') +'】不存在！');
          return;
        }
        this.$message({message: '样本数据更新完成！', type: 'success'});
        this.getSampleList();
        this.$set(this.uploadUpdateSampleDialog, 'visible', false);
      })
    },
    openUploadUpdateSampleDialog () {
      this.$set(this.uploadUpdateSampleDialog, 'visible', true);
      this.$set(this.uploadUpdateSampleDialog, 'title', '更新样本');
    },
    checkFastq () {
      seqSampleApi.updateIsExist(this.checkedProject.id).then(res => {
        this.$message({message: 'FastQ文件是否存在检测完成！', type: 'success'});
        this.getSampleList();
      })
    },
    uploadSample () {
      this.uploadSampleForm.projectId = this.checkedProject.id;
      seqSampleApi.uploadResearchSample(this.uploadSampleForm).then(res => {
        this.$message({message: '样本数据解析完成！', type: 'success'});
        this.getSampleList();
        this.$set(this.uploadSampleDialog, 'visible', false);
      })
    },
    openUploadSampleDialog () {
      this.$set(this.uploadSampleDialog, 'visible', true);
      this.$set(this.uploadSampleDialog, 'title', '导入样本');
    },
    closeUploadSampleDialog () {
      this.$set(this.uploadSampleDialog, 'visible', false);
    },
    closeUploadUpdateSampleDialog () {
      this.$set(this.uploadUpdateSampleDialog, 'visible', false);
    },
    setListValid (valid) {
      seqSampleApi.setListValid(this.checkedProject.id, valid).then(res => {
        this.$message({message: '样本有效性设置成功！', type: 'success'});
        this.getSampleList()
        this.validVisible = false;
      })
    },
    saveValid () {
      seqSampleApi.setValid(this.checkedSampleId, this.validVal).then(res => {
        this.$message({message: '样本有效性设置成功！', type: 'success'});
        this.getSampleList()
        this.validVisible = false;
      })
    },
    openVaild (row) {
      this.validVisible = true;
      this.validVal = row.isValid == null ? '' : (row.isValid ? 'true' : 'false');
      this.checkedSampleId = row.id;
    },
    clsoeVaild () {
      this.validVisible = false;
      this.checkedSampleId = '';
      this.validVal = '';
    },
    search () {
      this.getSampleList()
      this.searchDialog = false;
    },
    addSearchFormData () {
      this.searchFormData.push({})
    },
    openSearchDialog () {
      this.searchFormData = [];
      this.searchDialog = true;
    },
    closeSearchDialog () {
      this.searchDialog = false;
    },
    sendKafka (row) {
      seqSampleApi.sendKafka(row.id, row.type).then(res =>{
        this.$message({message: '科研样本已发送至Kafka！', type: 'success'});
      })
    },
    openDialog(row) {
      this.$set(this.dialog, 'visible', true);
      let that = this;
      seqProjectApi.listByType('SCIENTIFIC_RESEARCH').then(res => {
        this.projectList = res.data;
        if (row) {
          this.$set(this.dialog, 'title', '编辑科研样本信息');
          seqSampleApi.get(row.id).then((res) => {
            let data = res.data;
            that.formData = data;
          });
        } else {
          this.$set(this.dialog, 'title', '新增科研样本信息');
          that.formData = {};
        }
      })
    },
    addOrUpdate() {
      let that = this;
      this.formData.sampleType = 'SCIENTIFIC_RESEARCH'
      this.$refs['seqSampleFormRef'].validate((valid) => {
        if (valid) {
          this.formData.seqProjectId = this.checkedProject.id;
          if (this.formData.id) {
            seqSampleApi.update(this.formData).then((res) => {
              this.$message({message: '科研样本更新成功！', type: 'success'});
              that.closeDialog();
            });
          } else {
            seqSampleApi.add(this.formData).then((res) => {
              this.$message({message: '科研样本添加成功！', type: 'success'});
              that.closeDialog();
            });
          }
        } else {
          this.$message.error('必填字段未填写！');
          return false;
        }
      });
    },
    closeDialog() {
      this.$set(this.dialog, 'visible', false);
      this.$set(this.dialog, 'title', '');
      this.$refs['seqSampleFormRef'].resetFields();
      this.getSampleList();
    },
    handleDelete(row) {
      if (row) {
        this.$confirm('此操作将永久删除数据, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          seqSampleApi.delete(row.id).then((res) => {
            this.$message({message: '科研样本删除成功！', type: 'success'});
            this.getSampleList();
          });
        }).catch(() => {});
      } else {
        this.$message.error('暂不支持批量删除科研样本信息！');
      }
    },
    reback () {
      this.$emit("close");
    },
    sampleHandleCurrentChange (val) {
      this.sampleQueryParams.pageNum = val;
      this.getSampleList();
    },
    handleTabsClick (tab, event) {
      switch (this.activeName) {
        case 'task':
          this.getTaskList();
          break;
        case 'sample':
          this.getSampleList();
          break;
        case 'workspace':
          break;
      }
    },
    getSampleList () {
      this.loading = true;
      let searchFormData = this.searchFormData;
      searchFormData.push({
        name: 'seqProjectId',
        searchVal: this.checkedProject.id,
        searchType: 'EQUAL',
      })
      /*searchFormData.push({
        name: 'sampleType',
        searchType: 'EQUAL',
        searchVal: 'SCIENTIFIC_RESEARCH'
      })*/
      let params = {
        number: this.sampleQueryParams.pageNum,
        size: this.sampleQueryParams.pageSize,
        criteriaVos: searchFormData,
      };
      seqSampleApi.page(params).then((res) => {
        let data = res.data;
        let index = 1
        data.content.forEach((v) => {
          v.dataIndex = index++;
          v.layoutText = v.layout ? (v.layout === 'PAIRED' ? '双端测序' : '单端测序') : '-';
          v.isValidText = v.isValid != null ? (v.isValid ? '是' : '否') : '-'
          v.isExistText = v.isExist != null ? (v.isExist ? '存在' : '不存在') : '-'
          v.speciesText = this.speciesMap[v.species];
        });
        this.sampleDataList = data.content;
        
        this.sampleTotal = data.count;
        this.loading = false;
        this.drawChart('group');
        // this.drawChart('strategy');
        // this.drawChart('layout');
        this.drawChart('isValid');
        this.drawChart('isExist');
      }).catch(() => {});
    },
    getTaskList () {
      this.loading = true;
      dfTaskApi.listByProjectId(this.checkedProject.id).then((res) => {
        let data = res.data;
        let index = 1
        data.forEach((v) => {
          v.createTimeText = formatDate(new Date(v.createTime), "YYYY-mm-dd HH:MM:SS")
          v.updateTimeText = formatDate(new Date(v.updateTime), "YYYY-mm-dd HH:MM:SS")
          v.dataIndex = index++;
        });
        this.taskList = data;
        this.loading = false;
      }).catch(() => {});
    },
    handleSelectionChange(val) {
      this.ids = [];
      val.forEach(v => {
        this.ids.push(v.id);
      });
    },
    sampleHandleSizeChange (val) {
      this.sampleQueryParams.pageSize = val;
      this.getSampleList();
    },
    drawChart(title) {
      let chartTitle = '样本分组';
      if (title == 'group') {
        chartTitle = '样本分组';
      } else if (title == 'strategy') {
        chartTitle = '实验策略';
      } else if (title == 'layout') {
        chartTitle = '测序方式';
      } else if (title == 'isValid') {
        chartTitle = '是否有效';
      } else if (title == 'isExist') {
        chartTitle = '是否存在';
      }
      let dataChart = this.$echarts.init(document.getElementById(title));
      seqSampleApi.countGroup(this.checkedProject.id, title).then(res => {
        let data = res.data;
        let chartData = [];
        data.forEach(v => {
          let name = v.name;
          if (title == 'group') {
          } else if (title == 'strategy') {
          } else if (title == 'layout') {
            name = (name == null || name == '-') ? '-' : (name == 'PAIRED' ? '双端测序' : '单端测序');
          } else if (title == 'isValid') {
            name = (name == null || name == '-') ? '-' : (name == 'true' ? '有效' : '无效');
          } else if (title == 'isExist') {
            name = (name == null || name == '-') ? '-' : (name == 'true' ? '存在' : '不存在');
          }
          chartData.push({
            name: name,
            value: v.count
          });
        })
        let option = {
          title: {
            left: 'center',
          },
          tooltip: {},
          legend: {
            orient: 'vertical',
            left: 'left'
          },
          series: [
            {
              name: chartTitle,
              type: 'pie',
              radius: '50',
              data: chartData,
              emphasis: {
                itemStyle: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
              }
            },
          ],
        };
        dataChart.setOption(option);
        dataChart.off('click')
        dataChart.on('click', (params) => {
          let title = params.seriesName;
          let value = params.data.name;
          let searchFormData = [];
          if (title == '样本分组') {
            searchFormData.push({
              name: 'group',
              searchVal: value,
              searchType: 'EQUAL',
            })
          } else if (title == '是否有效') {
            searchFormData.push({
              name: 'isValid',
              searchVal: value == '无效' ? false : true,
              searchType: 'EQUAL',
            })
          } else if (title == '是否存在') {
            searchFormData.push({
              name: 'isExist',
              searchVal: value == '不存在' ? false : true,
              searchType: 'EQUAL',
            })
          }
          this.searchFormData = searchFormData;
          this.getSampleList();
        })
      })
    },
  },
  created() {
    this.getSampleList();
  }
};
</script>

<style scoped>
.el-pagination {
  margin-top: 10px;
  float: right;
  margin-bottom: 10px;
}
/deep/.demo-table-expand {
  font-size: 0;
}
/deep/.demo-table-expand label {
  width: 8%;
  margin-left: 10px;
  color: #99a9bf;
}
/deep/.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 80%;
}
</style>